<?php

namespace addons\Car\common\enums;
use common\enums\BaseEnum;
/**
 * 枚举
 *
 * Class GenderEnum
 * @package common\enums
 * @author YiiFrame <21931118@qq.com>
 */
class CarStateEnum extends BaseEnum
{
    const Free = 0;
    const Used = 1;
    const Repair = 2;

    /**
     * @return array
     */
    public static function getMap(): array
    {
        return [
            self::Free => '空闲',
            self::Used => '使用中',
            self::Repair => '维修中',
        ];
    }

    public static function getValue($key): string
    {
        return static::getMap()[$key] ?? '';
    }
}